package com.ygp.basic;

import lombok.extern.slf4j.Slf4j;

import java.util.concurrent.TimeUnit;

/**
 * <Description> <br>
 *
 * @author linmiaolai@sanyygp.com<br>
 * @version 1.0<br>
 * @date 2021/10/14 <br>
 */
@Slf4j(topic = "c.TestSleep")
public class TestSleep {
    public static void main(String[] args) {
        Thread newThread = new Thread("t1") {
            @Override
            public void run() {
                try {
//                    Thread.sleep(500);
                    TimeUnit.SECONDS.sleep(500);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        };
        newThread.start();
        log.debug("t1线程状态：{}", newThread.getState());
    }
}
